<?php

/**
 * Description of Room
 *
 * @author Scott McKay
 */
 class Application_Model_Room extends Zend_Db_Table_Abstract {
 	
 	protected $_name = 'Room';
 	
 	public function getRoom($id) {
 		$sql = "SELECT Room_ID FROM Room WHERE Room_ID = ?";
 		$params = array($id);
 		return $this->getAdapter()->query($sql,$params)->fetchAll();
 	}
 	
 	public function getRooms() {
 		$sql = "SELECT Room_ID FROM Room";
 		return $this->getAdapter()->query($sql)->fetchAll();
 	}
 	
 	/**
 	 * Function to add a room to the database
 	 * 
 	 * @param Room_ID The ID of the new room
 	 */
 	public function addRoom() {
		$sql = "INSERT INTO Room (Room_ID) VALUES (Null);";
		$this->getAdapter()->query($sql);
	}
	
	public function deleteRoom($id) {
		$sql = "DELETE FROM Room WHERE Room_ID = ?";
		$params = array($id);
		$this->getAdapter()->query($sql,$params);
	}
 }
 
 ?>
